 <template>
  <div>
    <button v-on:click="show = !show">Toggle</button>
    <transition name="fade">
      <p v-if="show">你好</p>
    </transition>
  </div>
</template>
 <script>
export default {
  data() {
    return {
      show: true,
    };
  },
  methods: {},
  computed: {},
  mounted(){
      this.$router.push({query:this.show})
  }
};
</script>
 <style lang='css'>
.fade-enter-active,
.fade-leave-active {
  transition: all 0.3s;
}
.fade-enter /* .fade-leave-active below version 2.1.8 */ {
    margin-top: -20px;
}
.fade-leave-to{
    margin-top: 20px;
    
}
</style>  